#ifndef _HJ212_CLIENT_H
#define _HJ212_CLIENT_H

#include "hj212_client_def.h"

int hj212_client_init(struct hj212_client *client, int id,
                      enum hj212_protocol_type protocol,
                      const struct hj212_client_ops *ops);
void hj212_client_destroy(struct hj212_client *client);
int hj212_client_start(hj212_client_t client);
int hj212_client_stop(hj212_client_t client);
int hj212_client_updata_begin(hj212_client_t client, int type, time_t begin, time_t end, int mode);

int hj212_client_pushstate(hj212_client_t client, int type, uint32_t enable);
int get_hj212_client_pushstate(hj212_client_t client, int type);

void hj212_handle(struct hj212_client *client);


struct send_buffer *hj212_acquire_sendbuf(hj212_client_t client);
void hj212_append_sendbuf(hj212_client_t client, struct send_buffer *buffer, void (*callback)(struct hj212_client *, void *p), void *p);
void hj212_recycle_sendbuf(hj212_client_t client, struct send_buffer *buffer);
int hj212_free_sendbuf_isempty(hj212_client_t client);


#endif
